<template>
  <div class="index_index_container">
    <el-form>
      <div class="index_index_title_container">
        <h3>湖南大学课程管理系统</h3>
      </div>
      <el-form-item label="">
        <editor  id="tinymce" v-model="homeDescription" :init="init"></editor>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import {getHomeDescription} from '@/api/setting'
import tinymce from 'tinymce/tinymce'
import 'tinymce/themes/silver/theme'
import Editor from '@tinymce/tinymce-vue'
export default {
  name: 'index',
  data () {
      return {
          homeDescription : '',
          init : {
              language_url: '/tinymce/zh_CN.js',
              language: 'zh_CN',
              skin_url: '/tinymce/skins/ui/oxide',
              height:600,
              menubar: false,
              toolbar: false
          }
      };
  },
    //vue初始化成功 则触发请求去获取后台首页说明
  mounted() {
      // getHomeDescription().then(response => {
      //     this.homeDescription = response.data.homeInfo;
      // });
      // tinymce.init({});
  },
  components: {Editor}
}
</script>

<style lang="scss" scoped>
 .index_index_container {
   width: 100%;
   min-width: 100%;
   overflow: hidden;
   .el-form {
     position:relative;
     width:1000px;
     max-width: 100%;
     overflow: hidden;
     margin: 10px auto;
   }
   .index_index_title_container {
      font-size: 20px;
      h3 {
        text-align: center;
      }
   }
 }
</style>
